namespace AdmissionQA.Domain.Entities;

/// <summary>
/// 学费实体
/// </summary>
public class TuitionFee : EntityBase
{
    /// <summary>
    /// 关联专业Id
    /// </summary>
    public Guid MajorId { get; private set; }

    /// <summary>
    /// 学费金额（单位：元）
    /// </summary>
    public decimal TuitionAmount { get; private set; }

    /// <summary>
    /// 住宿费（单位：元）
    /// </summary>
    public decimal AccommodationFee { get; private set; }

    /// <summary>
    /// 向量化Embedding字段
    /// </summary>
    public float[]? Embedding { get; set; }

    /// <summary>
    /// 构造函数
    /// </summary>
    private TuitionFee(Guid majorId, decimal tuitionAmount, decimal accommodationFee)
    {
        MajorId = majorId;
        TuitionAmount = tuitionAmount;
        AccommodationFee = accommodationFee;
    }

    /// <summary>
    /// 创建学费实例
    /// </summary>
    public static TuitionFee? CreateTuitionFee(Guid majorId, decimal tuitionAmount, decimal accommodationFee)
    {
        // 可以添加一些判断

        return new TuitionFee(majorId, tuitionAmount, accommodationFee);
    }

    /// <summary>
    /// 更新学费信息
    /// </summary>
    public bool UpdateTuitionFee(Guid newMajorId, decimal newTuitionAmount, decimal newSccommodationFee, string? newDescription)
    {
        // 可以加入一些条件判断

        MajorId = newMajorId;
        TuitionAmount = newTuitionAmount;
        AccommodationFee = newSccommodationFee;
        Description = newDescription;

        return true;
    }
}